/**
 * Copyright 2012-2020 The MicroRpc Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package com.ww.microrpc.rpc;

import java.io.Serializable;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.BitSet;

public final class MethodMetadata implements Serializable {

  private static final long serialVersionUID = 1L;
  private String configKey;
  private transient Type returnType;
  private boolean ignored;
  private String methodName;
  private String className;
  private transient Class<?> targetType;
  private transient Method method;

  MethodMetadata() {

  }

  public String configKey() {
    return configKey;
  }

  public MethodMetadata configKey(String configKey) {
    this.configKey = configKey;
    return this;
  }

  public Type returnType() {
    return returnType;
  }

  public MethodMetadata returnType(Type returnType) {
    this.returnType = returnType;
    return this;
  }

  public void ignoreMethod() {
    this.ignored = true;
  }

  public boolean isIgnored() {
    return ignored;
  }

  public MethodMetadata targetType(Class<?> targetType) {
    this.targetType = targetType;
    return this;
  }

  public Class<?> targetType() {
    return targetType;
  }

  public MethodMetadata method(Method method) {
    this.method = method;
    return this;
  }


  public Method method() {
    return method;
  }

  public String methodName() {
    return methodName;
  }

  public void methodName(String methodName) {
    this.methodName = methodName;
  }

  public String className() {
    return className;
  }

  public void className(String className) {
    this.className = className;
  }
}
